package sy.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.log4j.Logger;

import sy.dao.AppPlantDaoI;
import sy.model.AppPlant;
import sy.service.AppPlantServiceI;

@Service("appPlantService")
public class AppPlantServiceImpl implements AppPlantServiceI {
	
	private static final Logger logger = Logger.getLogger(AppPlant.class);
	@Autowired
	private AppPlantDaoI appPlantDao;


	@Override
	public Serializable save(AppPlant appPlant) {
		
		return appPlantDao.save(appPlant);
	}

	@Override
	public void remove(String[] ids) {
		for (int i = 0; i < ids.length; i++) {
			AppPlant appPlant =	appPlantDao.getAppPlantById(ids[i]);
			appPlantDao.remove(appPlant);
		}
	}

	@Override
	public void update(AppPlant appPlant) {
		// TODO Auto-generated method stub
		appPlantDao.update(appPlant);
	}

	@Override
	public List<AppPlant> getList() {
		// TODO Auto-generated method stub
		return appPlantDao.getList();
	}

	@Override
	public AppPlant getAppPlantById(String id) {
		// TODO Auto-generated method stub
		return appPlantDao.getAppPlantById(id);
	}

	@Override
	public List<AppPlant> getListAppPlantByKey(String key) {
		// TODO Auto-generated method stub
		return appPlantDao.getListAppPlantByKey(key);
	}

	@Override
	public AppPlant getAppPlantByCode(String code) {
		// TODO Auto-generated method stub
		return appPlantDao.getAppPlantByCode(code);
	}

}
